package com.example.demo.service;

import com.example.demo.entity.Class;
import com.example.demo.repository.ClassRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassService {
    @Autowired
    ClassRepository classRepository;
   public Class findById(Integer id){
       return classRepository.findById(id).orElse(null);
    }
    public List<Class> findAll(){
       return classRepository.findAll();
    }

}
